﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8" />
    <title>驰骋流程&表单设计器 </title>
    <base target="_self" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />

    <link href="../../WF/Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <!--<link href="login.css" rel="stylesheet" type="text/css" />-->
    <script src="../../WF/Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../WF/Scripts/bootstrap/js/jquery.min.js"></script>
    <script src="../../WF/Scripts/config.js" type="text/javascript"></script>
    <script src="../Standard/js/md5.js"></script>
    <script src="../../WF/Comm/Gener.js" type="text/javascript"></script>
    <script src="../../WF/Scripts/bootstrap/js/bootstrap.min.js"></script>
    <script src="../Standard/layer/layer.js"></script>
    <script src="../../WF/Scripts/layui/layui/layui.js"></script>
    <link rel="stylesheet" href="../../WF/Scripts/layui/layui/css/layui.css">
    <script type="text/javascript">
        document.onkeydown = function (e) {
            e = e || window.event;
            if (e.keyCode == 13) {
                Login();
                return false;
            }
        }
        var orgNo = null;
        //初始化页面函数.....
        $(function () {

            localStorage.setItem('Token', '');
           /* ShowDDL();
            //处理二级域名.
            orgNo = GetOrgNo();
            if (orgNo == null) {
                //没有获取到组织编号,就需要使用手机号登录.
                $("#TB_No").attr("placeholder", "账号");
            }*/

            //清空token
            localStorage.setItem("Token", "");
            var doType = GetQueryString("DoType");
            var href = GetHrefUrl();
            var urlParam = href.substring(href.indexOf('?') + 1, href.length);
            urlParam = urlParam.replace('&DoType=', '&DoTypeDel=xx');

            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Portal");
            if (doType != null && doType != undefined && doType != "")
                handler.AddPara("LoginType", doType);
            handler.AddUrlData(urlParam);
            data = handler.DoMethodReturnString("Login_Init");
            if (data.indexOf('err@') == 0) {
                alert(data);
                return;
            }
        });

        function LoginAdmin() {
            SetHref("./Admin/Login.htm");
        }

        function LoginText() {
            SetHref("Default.htm");
        }
        function ShowDDL() {
            var userID = $("#TB_No").val();
            var pass = $("#TB_PW").val();
            if (userID == null || userID.trim() == "") {
                //alert("请输入帐号.");
                return;
            }
            if (pass == null || pass.trim() == "") {
                //alert("请输入帐号.");
                return;
            }
            ShowOrgNos(userID,pass);

        }
        function GetOrgNo() {

            //处理二级域名.
            var domain = GetQueryString("OrgNo");

            //如果没有就从url获取二级域名.
            if (domain == null || domain == '') {

                var url = window.location.href.toLowerCase();
                if (url.indexOf('localhost') != -1)
                    return null;

                if (url.indexOf('//ccbpm.cn') != -1)
                    return null;

                /** var h = url.split(".")[0];
                 var domain = h.split("//")[1];
                 if (domain != null)
                 domain = domain.toLowerCase();

                 if (domain == 'www' || domain == 'ww')
                 return null;

                 var url = "http://www.ccbpm.cn/Default.htm?OrgNo=" + domain;
                 window.location.href = url;
                 return null;*/
            }
            return domain;
        }

        function ShowOrgNos(userID,pass) {
            if (userID == null || userID.trim() == "")
                return;
            if (pass == null || pass.trim() == "")
                return;
            // $("#帐号登录").html();
            $("#errMsg").html("正在加载组织...");
            var handler = new HttpHandler("BP.Cloud.HttpHandler.Portal_SaaS");
            handler.AddPara("TB_No", userID);
            handler.AddPara("TB_PW", pass);
            var data = handler.DoMethodReturnString("User_OrgNos");
            if (data.indexOf("err@") != -1) {
                layer.msg("用户名输入错误或者已经被禁用", { icon:2, time:3000});
                return;
            }

            if ($("#errorID").length > 0)
                $("#errorID").remove();

            //返回组织信息给登录方法
            return  JSON.parse(data);
        }
        //执行后台登录.
        function Login(isZZJ) {
            var userNo = $("#TB_No").val();
            var pass = $("#TB_PW").val();
            //如果org为空则去获取
            if(orgNo == null || orgNo ==""){
                var dataOrg = ShowOrgNos(userNo,pass);
                if(dataOrg === undefined) return;
                if (dataOrg.indexOf("err@") != -1) {
                    layer.msg("用户名输入错误或者已经被禁用", { icon:2, time:3000});
                    return;
                }

                if ($("#errorID").length > 0)
                    $("#errorID").remove();
                var orgstr = [];
                orgstr = dataOrg;

                //判断如果data中只有1条数据直接走登录方法，否则弹出框显示多个组织供选择
                if(orgstr.length > 1){
                    var _html = "<div class='contentOrg'>"
                    _html += "<ul class='selectOrg'>";
                    for(var i=0;i < orgstr.length;i++){
                        var org = orgstr[i];
                        //遍历获得组织名通过点击组织名，获取对应的组织信息
                        _html += '<li style="line-heigth:34px;font-size:16px;font-weight:600;cursor: pointer;" onclick="selectOrg(\'' + org.no + '\',\'' + org.name + '\',\'' + isZZJ + '\')">' + org.name+ '</li>';
                    }
                    _html += "</ul></div>";


                    //弹窗让用户选择组织(进入页面自动打开弹窗)
                    layui.use(['layer'], function () {
                        var layer = layui.layer;
                        layer.open({
                            type: 1, // page 层类型
                            area: ['500px', '300px'],
                            title: '请选择组织',
                            shadeClose: true, // 点击遮罩区域，关闭弹层
                            anim: 0, // 0-6 的动画形式，-1 不开启
                            content: _html,
                        });
                    });
                    return ;
                }else{
                    orgNo = orgstr[0].no;
                    DoLogin(isZZJ);
                }
            }

        }

        function DoLogin(loginType){
            var handler = new HttpHandler("BP.Cloud.HttpHandler.Portal_SaaS");
            var userNo = $("#TB_No").val();
            var pass = $("#TB_PW").val();
            if (userNo == "" || pass == "") {
                layer.msg("<font color=red>请输入用户名，密码.</font>");
                return;
            }
            // var orgNo = GetQueryString("OrgNo");
            handler.AddPara("TB_No", userNo);
            handler.AddPara("TB_PW", pass);
            handler.AddPara("OrgNo", orgNo);
            var data = handler.DoMethodReturnString("Login_Submit");
            if (data.indexOf('err@') == 0) {
                layer.msg("<font color=red>" + data + "</font>");
                $("#validate").show();
                return;
            }

            if (data.indexOf("err@") != -1) {
                alert(data);
                return;
            }

            if (loginType == 1) {
                SetHref('/WF/AppClassic/Home.htm');
                return;
            }

            SetHref("../Standard/Default.htm");
        }

        //手机扫描登录.
        function Mobile() {

            //alert("手机端代码不开放..");
            var url = "LoginGenerQRCodeMobile.htm";
            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Portal");
            var data = handler.DoMethodReturnString("LoginGenerQRCodeMobile_Init");
            if (data.indexOf("err@") == true) {
                //系统错误.
                alert(data);
                return;
            }
            WinOpen(data, "");
        }
        function selectOrg(no,name,loginType){
            orgNo = no;
            $('#orgName').html("-" + name);
            DoLogin(loginType);
            //layer.closeAll();
        }
    </script>
</head>

<body>
    <div class="container-fluid">
        <div class="login-container">
            <section class="login-sidebox">
                <div class="login-sidebox-content">
                    <div class="login-sidebox-header">
                        <div class="login-sidebox-logo">
                            <img alt="logo" src="../Standard/image/logo.png" /><span>SAAS登陆</span>
                        </div>
                        <h2 class="login-sidebox-subtitle">
                            <!--驰骋低代码开发平台<br /> CCFast 2.0-->
                            <div>驰骋低代码开发平台SAAS</div>
                            <div style="margin-top:10px;"> CCFast 2.0</div>
                        </h2>
                    </div>
                    <div class="login-sidebox-body">
                        <ul>
                            <li>流程引擎技术</li>
                            <li>表单引擎技术</li>
                            <li>场景应用规则</li>
                            <li>组织结构</li>
                        </ul>
                    </div>
                    <div class="login-sidebox-footer">
                        <div>
                            <a href="http://ccflow.org/frm=Localhost">官网</a> - <a href="http://doc.ccbpm.cn">文档</a> - <a href="http://ccflow.org/ke.htm">视频教程</a>
                        </div>
                    </div>
                    <div class="bottom-bg-img"></div>
                </div>
            </section>
            <section class="login-form">
                <div class="login-form-header">
                    <div id="incoName">驰骋软件<span id="orgName"></span></div>
                </div>
                <div class="login-form-body">
                    <form id="cc" class="form-signin">

                        <div class="login-wrap">

                            <div class="form-group">

                                <input type="text"   id="TB_No" name="TB_No"  lay-verify="required" class="form-control" />
                            </div>
                            <div class="form-group">

                                <input type="password" id="TB_PW" name="TB_PW"  lay-verify="required" class="form-control" />
                            </div>
                            <div id="">
                                <input type="button" class="btn btn-lg btn-login btn-block" value="登录-中间件" id="Btn_Login" onclick="Login(1);" />
                                <input type="button" class="btn btn-lg btn-login btn-block" value="登录-低代码开发平台" id="Btn_Login" onclick="Login(0);" />
                                <!--<input type="button" class="btn btn-lg btn-login btn-block" value="超管admin登陆" id="Btn_Login" onclick="LoginAdmin();" />-->
                                <br />

                                <div style="float:left">
                                    <a href="javascript:LoginAdmin()"> 超管admin登陆</a>
                                </div>

                            </div>
                            <!--<input type="button" class="btn btn-primary btn-block" value="测试版本test" id="Btn_LoginExt" onclick="LoginText();" />-->
                            <!--//  <input type="button" class="btn btn-primary btn-block" value="登录简洁版(开发中)" id="Btn_LoginSimple" onclick="LoginSimple();" />
                            // <input type="button" class="btn btn-primary btn-block" value="登录表单引擎(开发中)" id="Btn_LoginFrm" onclick="LoginFrm();" />-->
                            <!--<div class="text-center">
                            <div class="forget-password">
                                <a href="javascript:Mobile();">手机登录</a>-->
                            <!--<a href="../AppClassic/Login.htm">前台登录</a>-->
                            <!--</div>
                            </div>-->
                        </div>
                        <div>
                            <!--<div class="login-other">
                                <span class="text-muted">
                                    其他资源
                                </span>
                            </div>
                            <div class="login-list">
                                <div class="item">
                                    <a href="#" data-toggle="tooltip" title="官网">-->
                            <!--<img class="item" src="image/gitee.svg" />-->
                            <!--</a>
                                </div>
                                <div class="item">
                                    <a href="#" data-toggle="tooltip" title="使用 GitHub 帐号登录">
                                        <img class="item" src="image/git.svg" />
                                    </a>
                                </div>
                                <div class="item">
                                    <a href="#" data-toggle="tooltip" title="微信">
                                        <img class="item" src="image/weixin-2.svg" />
                                    </a>
                                </div>
                                <div class="item">
                                    <a href="#" data-toggle="tooltip" title="使用 QQ 账号登录">
                                        <img class="item" src="image/qq.svg" />
                                    </a>
                                </div>
                                <div class="item">
                                    <a href="#" data-toggle="tooltip" title="使用支付宝账号登录">
                                        <img class="item" src="image/zhifubao.svg" />
                                    </a>
                                </div>
                            </div>-->
                        </div>
                    </form>
                </div>
            </section>
        </div>
        <div class="login-footer">
            <ul class="login-footer-body">
                <li>
                    <a href="http://ccflow.org?Frm=Localhot" target="_blank">地区：济南市高新区.碧桂园凤凰国际A座F19</a>
                </li>
                <li> <a href="http://ccflow.org?Frm=Localhot" target="_blank">电话：0531-82374939,18660153393</a></li>
                <li><a href="http://ccflow.org?Frm=Localhot" target="_blank">济南驰骋信息技术有限公司@2003-2022</a></li>
            </ul>
        </div>
    </div>

    <style type="text/css">
        html {
            font-size: 16px;
            -ms-overflow-style: auto;
        }

        .btn:focus,
        .btn:active:focus,
        .btn.active:focus,
        .btn.focus,
        .btn:active.focus,
        .btn.active.focus {
            outline: none;
            box-shadow: none;
        }

        body {
            color: #797979;
            background: #f1f2f7;
            -webkit-overflow-scrolling: touch;
            font-family: 'Microsoft YaHei';
        }

        a {
            color: #007bff;
            text-decoration: none;
        }

            a:hover {
                color: #17a2b8;
                text-decoration: none;
            }


        .container-fluid {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 1000px;
            background-image: url(../Standard/image/ccloginbg.jpg);
            background-size: 100% 100%;
            background-position: 100%;
            background-repeat: no-repeat;
        }

        .login-container {
            min-height: 570px;
            box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.5);
            display: flex;
            width: 1120px;
            border-radius: 2vh;
        }

            .login-container section {
                width: 50%;
            }

            .login-container .login-sidebox {
                position: relative;
                /*         background: -webkit-gradient(linear, left bottom, left top, from(#3a485a), to(#607089));
                background: linear-gradient(0deg, #3a485a 0%, #607089 100%);*/
                color: #fff;
                border-top-left-radius: 2vh;
                border-bottom-left-radius: 2vh;
                background:linear-gradient(to left, #4868b8, rgba(255, 255, 255, 0));
            }

                .login-container .login-sidebox::before, .login-container .login-sidebox::after {
                    content: '';
                    top: 0;
                    right: 0;
                    bottom: 0;
                    left: 0;
                    position: absolute;
                }

                .login-container .login-sidebox::before {
                    background: url(image/left-1.png) no-repeat 0 0;
                }

                .login-container .login-sidebox::after {
                    background: url(image/left-2.png) no-repeat right bottom;
                }

                .login-container .login-sidebox .login-sidebox-content {
                    padding: 80px 80px 48px;
                    position: relative;
                    z-index: 1;
                }

                    .login-container .login-sidebox .login-sidebox-content .login-sidebox-body ul {
                        padding-left: 20px;
                    }

                        .login-container .login-sidebox .login-sidebox-content .login-sidebox-body ul li {
                            margin: 10px 0;
                        }

        .login-sidebox-header {
            margin-bottom: 40px;
        }

        .login-sidebox-logo {
            display: flex;
            align-items: center;
            margin-bottom: 14px;
        }

            .login-sidebox-logo img {
                width: 48px;
                height: auto;
                border-radius: 50%;
                margin-right: 14px;
            }

            .login-sidebox-logo span {
                display: inline;
                font-size: 2rem;
                font-weight: 700;
            }

        .login-sidebox-subtitle {
            font-size: 20pt;
            font-weight: nor
        }

        .login-sidebox-footer {
            margin-top: 20px;
            border-top: solid 1px #ddd;
            padding-top: 20px;
            font-size: 0.875rem;
            font-weight: 500;
            position: relative;
            z-index: 10;
        }
            /*.bottom-bg-img {
            width: 240px;
            height: 240px;
            position: absolute;
            left: -10px;
            bottom: -120px;*/
            /*background-image: url(./image/ccloginbottom.png);*/
            /*background-size: 100% 100%;
            background-position: 100%;
        }*/

            .login-sidebox-footer a {
                cursor: pointer;
                color: #fff;
            }

        .login-form {
            padding: 64px;
            font-size: 0.875rem;
            border-top-right-radius: 2vh;
            border-bottom-right-radius: 2vh;
            background-color: #fff;
        }

        .login-form-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            margin-left: 40px;
            margin-bottom: 20px;
            margin-top: 10px;
            text-align: center;
        }

            .login-form-header div {
                margin-bottom: 0;
                font-size: 2rem;
                color: #122d70;
            }

        .form-signin {
            margin: auto;
            width: 80%;
        }


        .login-other {
            display: table;
            text-align: center;
            white-space: nowrap;
            margin: 0.25rem 0 0.625rem 0;
            margin-top: 30px;
        }

            .login-other:before, .login-other:after {
                background-image: url("");
                content: '';
                display: table-cell;
                position: relative;
                top: 50%;
                width: 50%;
                background-repeat: no-repeat;
            }

            .login-other:before {
                background-position: right 1em top 50%;
            }

            .login-other:after {
                background-position: left 1em top 50%;
            }

        .login-list {
            display: flex;
            justify-content: space-between;
            width: 80%;
            margin: auto;
            /*margin-left:30px;*/
        }

            .login-list .item {
                width: 25px;
                height: 25px;
            }

        .form-group {
            margin-bottom: 30px;
        }

        .login-wrap {
            margin-top: 35px;
        }

            .login-wrap .form-control {
                font-weight: bold;
                padding: 8px 10px;
                /*width:*/
                height: auto;
                line-height: 24px;
                border-radius: 2vh;
            }


        .btn-login {
            color: #fff;
            /*background: #fe7300;*/
            background-color: #122d70;
            border: 0px;
            border-radius: 2.5vh;
        }

            .btn-login:hover {
                /*background: #f38d30;*/
                background: #122d70;
                color: #fff;
                outline: none
            }

            .btn-login:focus {
                background: #122d70;
                color: #fff;
                border: 0px;
                outline: none;
            }

        .forget-password {
            padding: 16px 0;
        }

        @media (min-width: 768px) {
            .login-footer {
                display: block;
                position: absolute;
                bottom: 40px;
                width: 100%;
            }

                .login-footer .login-footer-body {
                    display: flex;
                    justify-content: space-around;
                    margin: auto;
                    padding-left: 0;
                    width: 1000px;
                }

                    .login-footer .login-footer-body li {
                        list-style: none;
                    }

                        .login-footer .login-footer-body li a {
                            /*color: #7e8392;*/
                            color: #fff;
                        }
        }
        .layui-layer-content{
            background: #eee;
        }
        .contentOrg{
            padding: 15px;
            background: #ffffff;
            margin: 25px;
            box-shadow: 0 0 5px 2px #d1d1d1;
        }
        .selectOrg{
            display: flex;
            flex-direction: column;
            margin: 10px 20px;
        }
        .selectOrg li{
            margin: 5px 0;
        }
    </style>

</body>
</html>
